<?php
class Cookie extends Object
{
    public static function Set($key, $value, $day = null, $path = null, $domain = null)
    {
        $day = $day ? $day : 30;
        return setcookie($key, $value, time()+60*60*24*$day, $path, $domain, false, true);
    }

    public static function Remove($key)
    {
        return setcookie($key, null, time()-1, FS);
    }

    public static function Get($key)
    {
        return self::IsExisted($key) ? $_COOKIE[$key] : null;
    }

    public static function IsExisted($key)
    {
        return isset($_COOKIE[$key]);
    }
}
?>
